<?php
/**
 * Created by PhpStorm.
 * User: fengzi
 * Date: 2019/5/29
 * Time: 17:18
 */

namespace app\vehicle\model;
use think\Model;

class Message extends Model
{
    public function getCreateTimeAttr($value)
    {
        return date('Y-m-d',$value);
    }
    public function add($type_id,$business_id,$user_id,$title,$contents){
        $data['type_id'] = $type_id;
        $data['user_id'] = $user_id;
        $data['business_id'] = $business_id;
        $data['title'] = $title;
        $data['contents'] = $contents;
        $data['create_time'] = time();
        Message::insert($data);
    }
}